package com.zzxx.controller;

import com.github.pagehelper.PageInfo;
import com.zzxx.pojo.Role;
import com.zzxx.pojo.UserRole;
import com.zzxx.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/roleController")
public class RoleController {
    @Autowired
    private RoleService roleService;
    @RequestMapping("/list")
    @ResponseBody
    public PageInfo<Role> getRoles(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "2") Integer pageSize){
        PageInfo<Role> pageInfo = roleService.getAllRoles(pageNum,pageSize);
        return pageInfo;
    }

    @RequestMapping("/getByUid")
    @ResponseBody
    public UserRole getByUid(String id){
        return null;
    }
}
